package com.xwh.week5;

public class Pr_8 {
    static long MOD=10000000000l;
    public static void main(String[] args) {
        long ans=0;
        for(int i=1;i<=1000;i++){
            ans=(ans+qmi(i,i))%MOD;
        }
        System.out.println(ans);
    }
    public static long qmi(long m,long n){
        long ans=1;
        while (n!=0){
            if((n&1)==1) ans=(ans*m)%MOD;
            m=m*m%MOD;
            n>>=1;
        }
        return ans%MOD;
    }
}
